#ifndef QUANTIZATIONMATRIX_H
#define QUANTIZATIONMATRIX_H

#include <stdint.h>

#include "cuda.h"
#include "cuda_runtime.h"
#include "device_launch_parameters.h"

class QuantizationMatrix
{
public:
    // Initializes each element at 1
    __host__ __device__ QuantizationMatrix();
    __host__ __device__ QuantizationMatrix(int columnLength);
    __host__ __device__ QuantizationMatrix(const QuantizationMatrix &qm);
    __host__ __device__ ~QuantizationMatrix();

	__host__ __device__ QuantizationMatrix& operator= (const QuantizationMatrix q);
    __host__ __device__ int &operator[]( const int i ) const { return _quantizationMatrix[i]; }
	__host__ __device__ int columnLength() const { return _columnLength; }
    __host__ __device__ int size() const { return _size; }

    /*
    ** When using setMatrix mind the way the matrix is defined.
    ** The matrix is column major.
    */
    __host__ __device__ void setMatrix(uint8_t *matrix);

    __host__ __device__ void setMatrix(int *matrix);

    /*
    ** When using setMatrixRowMajor note that the row major array is inputted in the column major of this class.
    ** The class matrix is column major.
    */
    __host__ __device__ void setMatrixRowMajor(int *matrix);


	__host__ __device__ int * getQuantizationMatrix() const { return _quantizationMatrix; }
	__host__ __device__ void setQuantizationMatrix(int * val) { _quantizationMatrix = val; }
	__host__ __device__ int getColumnLength() const { return _columnLength; }
	__host__ __device__ void setColumnLength(int val) { _columnLength = val; }
	__host__ __device__ int getSize() const { return _size; }
	__host__ __device__ void setSize(int val) { _size = val; }

private:
    // column major matrix
    int *_quantizationMatrix;
	int _columnLength;
	int _size;

};

#endif // QUANTIZATIONMATRIX_H
